package com.study.boot.event.listener;

import com.study.boot.event.AnotherEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author fangdengfu
 * @date 2020/7/4 9:56
 */
@Component
@Slf4j
public class AnotherListener {

    @EventListener
    @Async
    public void anotherListener(AnotherEvent anotherEvent) {
        log.info("收到另外一个事件： {}", anotherEvent.getMsg());
    }

}
